<table>
    <thead>
        <tr>
            <th>项目</th>
            @for($i = 0; $i < 12; $i++)
                <th>{{$i + 1}}月</th>
            @endfor
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach($data as $k => $v)
            <tr>
                <td>{{$pay_type[$k]}}</td>
                @for($i = 0; $i < 12; $i++)
                    <td>{{$v[$i + 1]->sum('price')}}</td>
                @endfor
            </tr>
        @endforeach
    </tbody>
</table>